//
//  XFYRobot.m
//  MyRobotApp
//
//  Created by 小肥羊 on 15/5/28.
//  Copyright (c) 2015年 小肥羊. All rights reserved.
//

#import "XFYRobot.h"

@implementation XFYRobot

#pragma mark - 初始化
- (id)initRobot:(NSString *)robotName
{
    self = [super init];
    if (self) {
        _robotName = robotName;
        _memory = [[XFYRobotMemory alloc] initMemory:robotName];
    }
    return self;
}

#pragma mark - 惰性初始化
- (XFYRobotLook *)appearance
{
    if (!_appearance) {
        NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"XFYRobotLook" owner:nil options:nil]; 
        _appearance = [views lastObject];
    }
    return _appearance;
}

- (XFYRobotState *)state
{
    if (!_state) {
        _state = [[XFYRobotState alloc] init];
    }
    return _state;
}


#pragma mark - 方法
- (void)idea:(NSString *)message
{
    NSLog(@"想法:%@",message);
    [self.appearance.expressShow setText:message];
}

@end
